import type { 
  IColumn, 
  AsyncVoid, 
  AddColumnParams,
  DropColumnParams,
  ColumnExistsParams,
  RenameColumnParams
} from '../../types'
import { HttpClient } from '../../HttpClient'

export class ColumnAPI implements IColumn {
  private httpClient: HttpClient

  constructor(httpClient: HttpClient) {
    this.httpClient = httpClient
  }

  public async add(params: AddColumnParams): AsyncVoid {
    return await this.httpClient.request<AddColumnParams, void>('add_column', params)
  }

  public async drop(params: DropColumnParams): AsyncVoid {
    return await this.httpClient.request<DropColumnParams, void>('drop_column', params)
  }

  public async exists(params: ColumnExistsParams): AsyncVoid {
    return await this.httpClient.request<ColumnExistsParams, void>('column_exists', params)
  }

  public async rename(params: RenameColumnParams): AsyncVoid {
    return await this.httpClient.request<RenameColumnParams, void>('rename_column', params)
  }
  
}
